rm(list=ls())
setwd("/Volumes/Disk2/Future_PM/Dataverse")
library(fields); library(maps); library(ncdf4);library(abind)
source('Function/get_geo.R')
source('Function/get_met.R')
source('Function/functions.R')
ss=load("Figures/Figure 8/Satellite_CF-T_slope.Rdata")
##################
dev.new(width=6,height=6)
mai=c(0.1, 0.05, 0.2, 0.05)
mgp=c(1.2, 0.4, 0)
tcl=-0.2
ps=12

m <- rbind(c(0,1, 0.90, 1),
				  c(0, 0.50, 0.6, 0.90), c(0.5, 1.0,0.6,0.90), 
				  c(0.2,0.8,0.55,0.8))
close.screen(all.screens = TRUE)
split.screen(m)
screen(1)
par(mai=mai, mgp=mgp, tcl=tcl, ps=ps)
text(x=0.5,y=0.2,"JJA daytime slopes of cloud fraction (> 680 hPa) and temperature ",cex=1.1)

screen(2)
par(mai=mai, mgp=mgp, tcl=tcl, ps=ps)
ap=slope2
ap[sig2>0.05]=NA
ap[ap<=-0.06]=-0.06;ap[ap>=0.06]=0.06
image(lon.out,lat.out, ap,zlim=c(-0.06,0.06),col=rwb.colors(32),xaxt='n',yaxt='n',xlab='',ylab='');
map("world", add = TRUE)
title('(a) Satellite',cex.main=1,font.main=1)
box()
screen(3)
par(mai=mai, mgp=mgp, tcl=tcl, ps=ps)
ap=slope1
ap[sig1>0.05]=NA
ap[ap<=-0.06]=-0.06;ap[ap>=0.06]=0.06
image(lon.out,lat.out, ap,zlim=c(-0.06,0.06),col=rwb.colors(32),xaxt='n',yaxt='n',xlab='',ylab='');
map("world", add = TRUE)
title('(a) GEOS5',cex.main=1,font.main=1)
box()
screen(4)
mai=c(0.1, 0.1, 0.05, 0.2)
par(mai=mai, mgp=mgp, tcl=tcl, ps=9)
image.plot(legend.shrink=0.9,legend.only=TRUE,zlim=c(-0.05,0.05),col=rwb.colors(32),horizontal=TRUE,legend.width=2.5,axis.args = list(mgp = c(0, 0.5, 0),tcl=-0.2,padj=-1
))
text(bquote(''~K^-1*''),x=par("usr")[2]-0.22,y=par("usr")[3]+0.63,srt=0, adj = 0,xpd=TRUE,cex=1.3)
